<template>
  <div class="search-box">
    <van-search @search="searchCallBack()" v-model.trim="searchValue" :placeholder="placeholder||'请输入搜索关键词'" show-action :clearable="false" shape="square">
      <div style="cursor: pointer;" @click="searchCallBack()" slot="action">搜索</div>
    </van-search>
  </div>
</template>
<script>
export default {
  props: ["placeholder"],
  data() {
    return {
      searchValue: "" //搜索值
    };
  },
  methods: {
    searchCallBack() {
      this.$emit("searchCallBack", this.searchValue);
    }
  }
};
</script>
<style scoped>
.search-box {
  width: 100%;
  height: auto;
}
</style>
